Improve indentation in 'lua-ts-mode' (bug#70785)
authorjohn muhl <jm@pub.pink>
Fri, 3 May 2024 20:51:01 +0000 (15:51 -0500)
committerYuan Fu <casouri@gmail.com>
Thu, 9 May 2024 03:36:37 +0000 (20:36 -0700)
commit73d2b829f06124fec8b65eebc68e87da48808086
treeff90d3d6472c1b4f8627e688ae20d87540ed5021
parent4eb363acc825ef3aaa5468ab5e206ecab5883acb
Improve indentation in 'lua-ts-mode' (bug#70785)

* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
- Ignore comments when aligning arguments, parameters and fields.
- Apply simpler rules to simpler usage of anonymous functions.
- Better handling of table as a function argument.
(lua-ts--comment-first-sibling-matcher):
(lua-ts--first-real-sibling-anchor):
(lua-ts--last-arg-function-call-matcher):
(lua-ts--top-level-function-call-matcher): New function.
(lua-ts--g-parent):
(lua-ts--g-g-parent): New function.
(lua-ts--g-g-g-parent): Use it.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Add tests.
lisp/progmodes/lua-ts-mode.el
test/lisp/progmodes/lua-ts-mode-resources/indent.erts